#pragma once

#include <opencv2/core/core.hpp>
#include "DxfLine.h"
#include "MachiningHole.h"

typedef cv::Rect_<double> DxfRect;

class DxfImage :
    public std::vector<DxfLine>
{
public:
    DxfImage(void);
    ~DxfImage(void);

    double VertexOffset() const { return m_vertexOffset; }
    void VertexOffset(double val) { m_vertexOffset = val; }

    bool GetDxfRect(DxfRect& rect);
    DxfLine FindLongestLine();
    DxfPoint GetCentrePoint();
    DxfPoint GetVertexPoint();
    
    void Translate(double x, double y, DxfImage& dstImage);
    void Zoom(double zoomX, double zoomY, DxfImage& dstImage);
    void Rotate(double angle, DxfImage& dstImage);
    void BuildCoordinate(DxfImage& vec);
    void GetRotageAngles(std::vector<double>& vec);
    void ToDrilling(double dTopMargin, double dBottomMargin, std::vector<CMachiningHole*> drills);
    void Save(const CString& filename);
private:
    double m_vertexOffset;
    
};

